package com.lovo.util;

import org.springframework.core.convert.converter.Converter;

import java.time.LocalDate;
import java.time.LocalDateTime;

public class LocalDateTimeChange implements Converter<String, LocalDateTime> {
    @Override
    public LocalDateTime convert(String s) {
        if (s != null && s.matches("\\d{4}-\\d{2}-\\d{2}\s\\d{2}:\\d{2}:\\d{2}")) {
            return LocalDateTime.parse(s);
        }
        return null;
    }
}
